#ifndef PHONELOGINWIDGET_H
#define PHONELOGINWIDGET_H

#include <QWidget>
#include<QLabel>
#include<QLineEdit>
#include<QPushButton>

class PhoneLoginWidget : public QWidget
{
    Q_OBJECT
public:
    explicit PhoneLoginWidget(QWidget *parent = nullptr);

    void sendVerifyCode();
    void sendVerifyCodeDone();

    void clickSubmitBtn();
    void phoneLoginDone(bool ok,const QString& reason);
    void phoneRegisterDone(bool ok,const QString& reason);

    void countDown();
    void switchMode();

private:

    QLabel* titleLabel;
    QLineEdit* phoneEdit;
    QLineEdit* verifyCodeEdit;
    QPushButton* sendVerifyCodeBtn;
    QPushButton* submitBtn;
    QPushButton* userModeBtn;
    QPushButton* switchModeBtn;


    bool isLoginMode = true;
    QString currentPhone = "";		//记录是使用哪个手机号发送的验证码
    //定时器
    QTimer* timer;
    int leftTime = 30;

};

#endif // PHONELOGINWIDGET_H
